<?php

namespace app\index\dao;

use app\common\model\ConsultingComment;
use ShidianUtil\Thinkphp\Dao\DaoTrait;

/**
 * ConsultingCommentDao 数据访问对象
 * Class ConsultingCommentDao
 * @package app\dao
 * @method ConsultingComment findByPK(?int $id, $field = true)
 * @method \think\Collection selectAll(?int $page, ?int $page_size, $field = true)
 * @method ConsultingComment insertActive(array $params, array $allow_field = [])
 * @method ConsultingComment updateActive(ConsultingComment $model, array $params, array $allow_field = [])
 * @method ConsultingComment findAndUpdateActive(int $id, array $params, array $allow_field = [])
 * @method ConsultingComment updateActiveByClosure(\Closure $closure, array $params, array $allow_field = [])
 * @method void deleteModel(ConsultingComment $model)
 * @method void deleteById(int|array|\Closure $id, bool $force = false)
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037579
 * @link https://www.kancloud.cn/manual/think-orm/1257998
 * @link https://www.kancloud.cn/thinkphp/master-database-and-model/265551
 */
class ConsultingCommentDao
{
    use DaoTrait;

    /**
     * @var \app\common\model\ConsultingComment
     */
    private $baseModel;

    /**
     * ConsultingCommentDao constructor.
     */
    public function __construct()
    {
        $this->baseModel = ConsultingComment::class;
    }

    public function findCardMessage($consultingMessageId){
        return ConsultingComment::where('consultingMessageId', $consultingMessageId)
            ->find();
    }

    public function selectCardMessage($consultingMessageIds){
        return ConsultingComment::whereIn('consultingMessageId', $consultingMessageIds)
            ->select();
    }
}
